/*     */ package com.yc.dao.station;
/*     */ 
/*     */ import btsm.bean.dbConnector;
/*     */ import com.yc.dao.model.AcdcDistributionBO;
/*     */ import com.yc.dao.model.AcdcDistributionMapBO;
/*     */ import com.yc.util.FormateSQL;
/*     */ import com.yc.util.ListContentsBFO;
/*     */ import java.sql.ResultSet;
/*     */ import java.text.SimpleDateFormat;
/*     */ import java.util.ArrayList;
/*     */ import java.util.Date;
/*     */ import java.util.List;
/*     */ import java.util.Map;
/*     */ import org.apache.commons.logging.Log;
/*     */ import org.apache.commons.logging.LogFactory;
/*     */ 
/*     */ public class AcdcDistributionDAO
/*     */ {
/*  22 */   private static final Log log = LogFactory.getLog(AcdcDistributionDAO.class);
/*  23 */   private dbConnector dbcon = null;
/*  24 */   private SimpleDateFormat open = new SimpleDateFormat("yyyy-MM-dd");
/*  25 */   private SimpleDateFormat fresh = new SimpleDateFormat("yyyy-MM-dd hh:mm:ss");
/*     */ 
/*     */   private void dbConInit() {
/*  28 */     if (this.dbcon == null)
/*  29 */       this.dbcon = new dbConnector();
/*     */   }
/*     */ 
/*     */   private void dbConClose() {
/*  33 */     if (this.dbcon != null)
/*  34 */       this.dbcon.closeAll();
/*  35 */     this.dbcon = null;
/*     */   }
/*     */ 
/*     */   public ListContentsBFO getAcdcDistributionList(Map condition)
/*     */   {
/*  40 */     ListContentsBFO bfo = new ListContentsBFO();
/*  41 */     int start = Integer.parseInt(condition.get("start").toString());
/*  42 */     int limit = Integer.parseInt(condition.get("limit").toString());
/*  43 */     String strBtscode = condition.get("BTS_CODE").toString();
/*  44 */     ResultSet rs = null;
/*  45 */     List list = new ArrayList();
/*     */     try
/*     */     {
/*  48 */       dbConInit();
/*  49 */       String strSQL = " select count(id) from acdcdistribution where btscode = '" + strBtscode + "' ";
/*  50 */       log.info(strSQL);
/*  51 */       rs = this.dbcon.execQuery(strSQL);
/*  52 */       if (rs.next()) {
/*  53 */         bfo.setTotalSize(rs.getInt(1));
/*     */       }
/*  55 */       strSQL = " select * from acdcdistribution where btscode ='" + strBtscode + "' limit " + start + ", " + limit;
/*  56 */       log.info(strSQL);
/*  57 */       rs = this.dbcon.execQuery(strSQL);
/*  58 */       while (rs.next()) {
/*  59 */         AcdcDistributionBO bo = new AcdcDistributionBO();
/*  60 */         bo.setId(rs.getString("id"));
/*  61 */         bo.setBtscode(rs.getString("btscode"));
/*  62 */         bo.setBtsname(rs.getString("btsname"));
/*  63 */         bo.setDistmanufacturer(rs.getString("distmanufacturer"));
/*  64 */         bo.setDisttype(rs.getString("disttype"));
/*  65 */         bo.setDistother(rs.getString("distother"));
/*  66 */         bo.setAirswitchM(rs.getString("airswitchM"));
/*  67 */         bo.setAirswitchT(rs.getString("airswitchT"));
/*  68 */         bo.setAirswitchC(rs.getString("airswitchC"));
/*  69 */         bo.setAirswitchO(rs.getString("airswitchO"));
/*  70 */         bo.setAirswitchCRD(rs.getString("airswitchCRD"));
/*  71 */         bo.setElecableDAS(rs.getString("elecableDAS"));
/*  72 */         bo.setElecableDAT(rs.getString("elecableDAT"));
/*  73 */         bo.setElecableDANum(rs.getString("elecableDANum"));
/*  74 */         bo.setElecableDALen(rs.getString("elecableDALen"));
/*  75 */         bo.setElecableDACRD(rs.getString("elecableDACRD"));
/*  76 */         bo.setRegulatorM(rs.getString("regulatorM"));
/*  77 */         bo.setRegulatorT(rs.getString("regulatorT"));
/*  78 */         bo.setRegulatorC(rs.getString("regulatorC"));
/*  79 */         bo.setRegulatorOT(rs.getDate("regulatorOT"));
/*  80 */         bo.setRegulatorCRD(rs.getString("regulatorCRD"));
/*  81 */         bo.setLighting(rs.getString("lighting"));
/*  82 */         bo.setSocket(rs.getString("socket"));
/*  83 */         bo.setElecableCPS(rs.getString("elecableCPS"));
/*  84 */         bo.setElecableCPT(rs.getString("elecableCPT"));
/*  85 */         bo.setElecableCPNum(rs.getString("elecableCPNum"));
/*  86 */         bo.setElecableCPLen(rs.getString("elecableCPLen"));
/*  87 */         bo.setElecableCPCRD(rs.getString("elecableCPCRD"));
/*  88 */         bo.setDDConverterT(rs.getString("DDConverterT"));
/*  89 */         bo.setDDConverterM(rs.getString("DDConverterM"));
/*  90 */         bo.setDDConverterNum(rs.getString("DDConverterNum"));
/*  91 */         bo.setDDConverterC(rs.getString("DDConverterC"));
/*  92 */         bo.setDDConverterOT(rs.getDate("DDConverterOT"));
/*  93 */         bo.setDDConverterCRD(rs.getString("DDConverterCRD"));
/*  94 */         bo.setDDisplayT(rs.getString("DDisplayT"));
/*  95 */         bo.setDDisplayM(rs.getString("DDisplayM"));
/*  96 */         bo.setDDisplayNum(rs.getString("DDisplayNum"));
/*  97 */         bo.setDDisplayC(rs.getString("DDisplayC"));
/*  98 */         bo.setDDisplayOT(rs.getDate("DDisplayOT"));
/*  99 */         bo.setMaintenance(rs.getString("maintenance"));
/* 100 */         bo.setRefreshtime(rs.getDate("refreshtime"));
/* 101 */         bo.setMemo(rs.getString("memo"));
/* 102 */         list.add(bo);
/*     */       }
/* 104 */       bfo.setData(list.toArray());
/*     */     }
/*     */     catch (Exception e) {
/* 107 */       e.printStackTrace();
/* 108 */       log.error(e.getMessage());
/*     */     }
/*     */     finally {
/* 111 */       dbConClose();
/*     */     }
/* 113 */     return bfo;
/*     */   }
/*     */ 
/*     */   public boolean saveAcdcDistributionBO(AcdcDistributionBO bo)
/*     */   {
/* 119 */     log.info("添加--交直流配电---开始");
/* 120 */     boolean flag = true;
/*     */     try
/*     */     {
/* 123 */       dbConInit();
/* 124 */       StringBuffer sqlBuf = new StringBuffer();
/* 125 */       sqlBuf.append(" insert into acdcdistribution ( btscode, btsname,  distmanufacturer,  disttype,");
/* 126 */       sqlBuf.append(" distother,  airswitchM, airswitchT, airswitchC,  airswitchO, airswitchCRD,");
/* 127 */       sqlBuf.append(" elecableDAS,  elecableDAT, elecableDANum, elecableDALen, elecableDACRD,");
/* 128 */       sqlBuf.append(" regulatorM,  regulatorT, regulatorC, registtime, regulatorCRD, lighting,");
/* 129 */       sqlBuf.append(" socket, elecableCPS, elecableCPT, elecableCPNum, elecableCPLen, elecableCPCRD,");
/* 130 */       sqlBuf.append(" DDConverterT, DDConverterM, DDConverterNum, DDConverterC, DDConverterOT,");
/* 131 */       sqlBuf.append(" DDConverterCRD, DDisplayT, DDisplayM,  DDisplayNum, DDisplayC,  DDisplayOT,");
/* 132 */       sqlBuf.append(" maintenance, refreshtime,  memo ) values ( ");
/* 133 */       sqlBuf.append(" '" + bo.getBtscode() + "' ,");
/* 134 */       sqlBuf.append(" '" + bo.getBtsname() + "' ,");
/* 135 */       sqlBuf.append(" '" + bo.getDistmanufacturer() + "' ,");
/* 136 */       sqlBuf.append(" '" + bo.getDisttype() + "' ,");
/* 137 */       sqlBuf.append(" '" + bo.getDistother() + "' ,");
/* 138 */       sqlBuf.append(" '" + bo.getAirswitchM() + "' ,");
/* 139 */       sqlBuf.append(" '" + bo.getAirswitchT() + "' ,");
/* 140 */       sqlBuf.append(" '" + bo.getAirswitchC() + "' ,");
/* 141 */       sqlBuf.append(" '" + bo.getAirswitchO() + "' ,");
/* 142 */       sqlBuf.append(" '" + bo.getAirswitchCRD() + "' ,");
/* 143 */       sqlBuf.append(" '" + bo.getElecableDAS() + "' ,");
/* 144 */       sqlBuf.append(" '" + bo.getElecableDAT() + "' ,");
/*     */ 
/* 146 */       sqlBuf.append(" '0' ,");
/* 147 */       sqlBuf.append(" '0' ,");
/* 148 */       sqlBuf.append(" '" + bo.getElecableDACRD() + "' ,");
/* 149 */       sqlBuf.append(" '" + bo.getRegulatorM() + "' ,");
/* 150 */       sqlBuf.append(" '" + bo.getRegulatorT() + "' ,");
/* 151 */       sqlBuf.append(" '" + bo.getRegulatorC() + "' ,");
/* 152 */       sqlBuf.append(" '" + this.fresh.format(bo.getRegulatorOT()) + "' ,");
/* 153 */       sqlBuf.append(" '" + bo.getRegulatorCRD() + "' ,");
/* 154 */       sqlBuf.append(" '" + bo.getLighting() + "' ,");
/* 155 */       sqlBuf.append(" '" + bo.getSocket() + "' ,");
/* 156 */       sqlBuf.append(" '" + bo.getElecableCPS() + "' ,");
/* 157 */       sqlBuf.append(" '" + bo.getElecableCPT() + "' ,");
/* 158 */       sqlBuf.append(" '" + bo.getElecableCPNum() + "' ,");
/* 159 */       sqlBuf.append(" '" + bo.getElecableCPLen() + "' ,");
/* 160 */       sqlBuf.append(" '" + bo.getElecableCPCRD() + "' ,");
/* 161 */       sqlBuf.append(" '" + bo.getDDConverterT() + "' ,");
/* 162 */       sqlBuf.append(" '" + bo.getDDConverterM() + "' ,");
/* 163 */       sqlBuf.append(" '" + bo.getDDConverterNum() + "' ,");
/* 164 */       sqlBuf.append(" '" + bo.getDDConverterC() + "' ,");
/* 165 */       sqlBuf.append(" '" + this.fresh.format(bo.getDDConverterOT()) + "' ,");
/* 166 */       sqlBuf.append(" '" + bo.getDDConverterCRD() + "' ,");
/* 167 */       sqlBuf.append(" '" + bo.getDDisplayT() + "' ,");
/* 168 */       sqlBuf.append(" '" + bo.getDDisplayM() + "' ,");
/* 169 */       sqlBuf.append(" '" + bo.getDDisplayNum() + "' ,");
/* 170 */       sqlBuf.append(" '" + bo.getDDisplayC() + "' ,");
/* 171 */       sqlBuf.append(" '" + this.fresh.format(bo.getDDisplayOT()) + "' ,");
/* 172 */       sqlBuf.append(" '" + bo.getMaintenance() + "' ,");
/* 173 */       sqlBuf.append(" '" + this.fresh.format(new Date()) + "' ,");
/* 174 */       sqlBuf.append(" '" + bo.getMemo() + "' )");
/*     */ 
/* 176 */       log.info(sqlBuf.toString());
/* 177 */       this.dbcon.execUpdate(sqlBuf.toString());
/*     */     }
/*     */     catch (Exception e)
/*     */     {
/* 181 */       flag = false;
/* 182 */       e.printStackTrace();
/* 183 */       log.error(e.getMessage());
/*     */     }
/*     */     finally {
/* 186 */       dbConClose();
/*     */     }
/* 188 */     log.info("添加--交直流配电---结束");
/* 189 */     return flag;
/*     */   }
/*     */ 
/*     */   public boolean updateAcdcDistributionBO(AcdcDistributionBO bo)
/*     */   {
/* 194 */     log.info("修改--交直流配电---开始");
/* 195 */     boolean flag = true;
/*     */     try
/*     */     {
/* 198 */       dbConInit();
/* 199 */       StringBuffer sqlBuf = new StringBuffer();
/* 200 */       sqlBuf.append(" update  acdcdistribution  set ");
/* 201 */       sqlBuf.append(" distmanufacturer = '" + bo.getDistmanufacturer() + "' ,");
/* 202 */       sqlBuf.append(" disttype = '" + bo.getDisttype() + "' ,");
/* 203 */       sqlBuf.append(" distother = '" + bo.getDistother() + "' ,");
/* 204 */       sqlBuf.append(" airswitchM = '" + bo.getAirswitchM() + "' ,");
/* 205 */       sqlBuf.append(" airswitchT = '" + bo.getAirswitchT() + "' ,");
/* 206 */       sqlBuf.append(" airswitchC = '" + bo.getAirswitchC() + "' ,");
/* 207 */       sqlBuf.append(" airswitchO = '" + bo.getAirswitchO() + "' ,");
/* 208 */       sqlBuf.append(" airswitchCRD = '" + bo.getAirswitchCRD() + "' ,");
/* 209 */       sqlBuf.append(" elecableDAS = '" + bo.getElecableDAS() + "' ,");
/* 210 */       sqlBuf.append(" elecableDAT = '" + bo.getElecableDAT() + "' ,");
/* 211 */       sqlBuf.append(" elecableDANum = '" + bo.getElecableDANum() + "' ,");
/* 212 */       sqlBuf.append(" elecableDALen = '" + bo.getElecableDALen() + "' ,");
/* 213 */       sqlBuf.append(" elecableDACRD = '" + bo.getElecableDACRD() + "' ,");
/* 214 */       sqlBuf.append(" regulatorM = '" + bo.getRegulatorM() + "' ,");
/* 215 */       sqlBuf.append(" regulatorT = '" + bo.getRegulatorT() + "' ,");
/* 216 */       sqlBuf.append(" regulatorC = '" + bo.getRegulatorC() + "' ,");
/* 217 */       sqlBuf.append(" registtime = '" + this.fresh.format(bo.getRegulatorOT()) + "' ,");
/* 218 */       sqlBuf.append(" regulatorCRD = '" + bo.getRegulatorCRD() + "' ,");
/* 219 */       sqlBuf.append(" lighting = '" + bo.getLighting() + "' ,");
/* 220 */       sqlBuf.append(" socket = '" + bo.getSocket() + "' ,");
/* 221 */       sqlBuf.append(" elecableCPS = '" + bo.getElecableCPS() + "' ,");
/* 222 */       sqlBuf.append(" elecableCPT = '" + bo.getElecableCPT() + "' ,");
/* 223 */       sqlBuf.append(" elecableCPNum = '" + bo.getElecableCPNum() + "' ,");
/* 224 */       sqlBuf.append(" elecableCPLen = '" + bo.getElecableCPLen() + "' ,");
/* 225 */       sqlBuf.append(" elecableCPCRD = '" + bo.getElecableCPCRD() + "' ,");
/* 226 */       sqlBuf.append(" DDConverterT = '" + bo.getDDConverterT() + "' ,");
/* 227 */       sqlBuf.append(" DDConverterM = '" + bo.getDDConverterM() + "' ,");
/* 228 */       sqlBuf.append(" DDConverterNum = '" + bo.getDDConverterNum() + "' ,");
/* 229 */       sqlBuf.append(" DDConverterC = '" + bo.getDDConverterC() + "' ,");
/* 230 */       sqlBuf.append(" registtime = '" + this.fresh.format(bo.getDDConverterOT()) + "' ,");
/* 231 */       sqlBuf.append(" DDConverterCRD = '" + bo.getDDConverterCRD() + "' ,");
/* 232 */       sqlBuf.append(" DDisplayT = '" + bo.getDDisplayT() + "' ,");
/* 233 */       sqlBuf.append(" DDisplayM = '" + bo.getDDisplayM() + "' ,");
/* 234 */       sqlBuf.append(" DDisplayNum = '" + bo.getDDisplayNum() + "' ,");
/* 235 */       sqlBuf.append(" DDisplayC = '" + bo.getDDisplayC() + "' ,");
/* 236 */       sqlBuf.append(" DDisplayOT = '" + this.fresh.format(bo.getDDisplayOT()) + "' ,");
/* 237 */       sqlBuf.append(" maintenance = '" + bo.getMaintenance() + "' ,");
/* 238 */       sqlBuf.append(" refreshtime = '" + this.fresh.format(new Date()) + "' ,");
/* 239 */       sqlBuf.append(" memo = '" + bo.getMemo() + "' ");
/* 240 */       sqlBuf.append(" where id = '" + bo.getId() + "'");
/*     */ 
/* 242 */       log.info(sqlBuf.toString());
/* 243 */       this.dbcon.execUpdate(sqlBuf.toString());
/*     */     }
/*     */     catch (Exception e)
/*     */     {
/* 247 */       flag = false;
/* 248 */       e.printStackTrace();
/* 249 */       log.error(e.getMessage());
/*     */     }
/*     */     finally {
/* 252 */       dbConClose();
/*     */     }
/* 254 */     log.info("修改--交直流配电---结束");
/* 255 */     return flag;
/*     */   }
/*     */ 
/*     */   public boolean deleteAcdcDistributionBO(String strID)
/*     */   {
/* 260 */     log.info("删除--交直流配电---开始");
/* 261 */     boolean flag = true;
/*     */     try
/*     */     {
/* 264 */       dbConInit();
/* 265 */       StringBuffer sqlBuf = new StringBuffer();
/* 266 */       sqlBuf.append(" delete from  acdcdistribution   ");
/* 267 */       sqlBuf.append(" where id = '" + strID + "'");
/*     */ 
/* 269 */       log.info(sqlBuf.toString());
/* 270 */       this.dbcon.execUpdate(sqlBuf.toString());
/*     */     }
/*     */     catch (Exception e)
/*     */     {
/* 274 */       flag = false;
/* 275 */       e.printStackTrace();
/* 276 */       log.error(e.getMessage());
/*     */     }
/*     */     finally {
/* 279 */       dbConClose();
/*     */     }
/* 281 */     log.info("删除--交直流配电---结束");
/* 282 */     return flag;
/*     */   }
/*     */ 
/*     */   public ListContentsBFO getAcdcDistributionByBtsName(Map condition)
/*     */   {
/* 287 */     ListContentsBFO bfo = new ListContentsBFO();
/* 288 */     int start = Integer.parseInt(condition.get("start").toString());
/* 289 */     int limit = Integer.parseInt(condition.get("limit").toString());
/* 290 */     String strBtsName = condition.get("btsName").toString();
/* 291 */     ResultSet rs = null;
/* 292 */     List list = new ArrayList();
/*     */     try
/*     */     {
/* 295 */       dbConInit();
/*     */ 
/* 297 */       Object objRegistBeginTime = condition.get("registBeginTime");
/* 298 */       Object objRegistEndTime = condition.get("registEndTime");
/*     */ 
/* 301 */       String strSQL = " select count(id) from acdcdistribution where ( btsname like '%" + strBtsName + "%' or distmanufacturer like '%" + strBtsName + "%' ) ";
/* 302 */       strSQL = FormateSQL.getFormateSQL(objRegistBeginTime, objRegistEndTime, strSQL);
/* 303 */       log.info(strSQL);
/* 304 */       rs = this.dbcon.execQuery(strSQL);
/* 305 */       if (rs.next()) {
/* 306 */         bfo.setTotalSize(rs.getInt(1));
/*     */       }
/* 308 */       strSQL = " select * from acdcdistribution where ( btsname like '%" + strBtsName + "%' or distmanufacturer like '%" + strBtsName + "%' ) ";
/* 309 */       strSQL = FormateSQL.getFormateSQL(objRegistBeginTime, objRegistEndTime, strSQL);
/* 310 */       strSQL = strSQL + "limit " + start + ", " + limit;
/* 311 */       log.info(strSQL);
/* 312 */       rs = this.dbcon.execQuery(strSQL);
/* 313 */       while (rs.next()) {
/* 314 */         AcdcDistributionBO bo = new AcdcDistributionBO();
/* 315 */         bo.setId(rs.getString("id"));
/* 316 */         bo.setBtscode(rs.getString("btscode"));
/* 317 */         bo.setBtsname(rs.getString("btsname"));
/* 318 */         bo.setDistmanufacturer(rs.getString("distmanufacturer"));
/* 319 */         bo.setDisttype(rs.getString("disttype"));
/* 320 */         bo.setDistother(rs.getString("distother"));
/* 321 */         bo.setAirswitchM(rs.getString("airswitchM"));
/* 322 */         bo.setAirswitchT(rs.getString("airswitchT"));
/* 323 */         bo.setAirswitchC(rs.getString("airswitchC"));
/* 324 */         bo.setAirswitchO(rs.getString("airswitchO"));
/* 325 */         bo.setAirswitchCRD(rs.getString("airswitchCRD"));
/* 326 */         bo.setElecableDAS(rs.getString("elecableDAS"));
/* 327 */         bo.setElecableDAT(rs.getString("elecableDAT"));
/* 328 */         bo.setElecableDANum(rs.getString("elecableDANum"));
/* 329 */         bo.setElecableDALen(rs.getString("elecableDALen"));
/* 330 */         bo.setElecableDACRD(rs.getString("elecableDACRD"));
/* 331 */         bo.setRegulatorM(rs.getString("regulatorM"));
/* 332 */         bo.setRegulatorT(rs.getString("regulatorT"));
/* 333 */         bo.setRegulatorC(rs.getString("regulatorC"));
/* 334 */         bo.setRegulatorOT(rs.getDate("registtime"));
/* 335 */         bo.setRegulatorCRD(rs.getString("regulatorCRD"));
/* 336 */         bo.setLighting(rs.getString("lighting"));
/* 337 */         bo.setSocket(rs.getString("socket"));
/* 338 */         bo.setElecableCPS(rs.getString("elecableCPS"));
/* 339 */         bo.setElecableCPT(rs.getString("elecableCPT"));
/* 340 */         bo.setElecableCPNum(rs.getString("elecableCPNum"));
/* 341 */         bo.setElecableCPLen(rs.getString("elecableCPLen"));
/* 342 */         bo.setElecableCPCRD(rs.getString("elecableCPCRD"));
/* 343 */         bo.setDDConverterT(rs.getString("DDConverterT"));
/* 344 */         bo.setDDConverterM(rs.getString("DDConverterM"));
/* 345 */         bo.setDDConverterNum(rs.getString("DDConverterNum"));
/* 346 */         bo.setDDConverterC(rs.getString("DDConverterC"));
/* 347 */         bo.setDDConverterOT(rs.getDate("DDConverterOT"));
/* 348 */         bo.setDDConverterCRD(rs.getString("DDConverterCRD"));
/* 349 */         bo.setDDisplayT(rs.getString("DDisplayT"));
/* 350 */         bo.setDDisplayM(rs.getString("DDisplayM"));
/* 351 */         bo.setDDisplayNum(rs.getString("DDisplayNum"));
/* 352 */         bo.setDDisplayC(rs.getString("DDisplayC"));
/* 353 */         bo.setDDisplayOT(rs.getDate("DDisplayOT"));
/* 354 */         bo.setMaintenance(rs.getString("maintenance"));
/* 355 */         bo.setRefreshtime(rs.getDate("refreshtime"));
/* 356 */         bo.setMemo(rs.getString("memo"));
/* 357 */         list.add(bo);
/*     */       }
/* 359 */       bfo.setData(list.toArray());
/*     */     }
/*     */     catch (Exception e) {
/* 362 */       e.printStackTrace();
/* 363 */       log.error(e.getMessage());
/*     */     }
/*     */     finally {
/* 366 */       dbConClose();
/*     */     }
/* 368 */     return bfo;
/*     */   }
/*     */ 
/*     */   public List export(String strBtsName, String strRegistBeginTime, String strRegistEndTime)
/*     */   {
/* 373 */     ResultSet rs = null;
/* 374 */     List list = new ArrayList();
/*     */     try
/*     */     {
/* 377 */       dbConInit();
/* 378 */       String strSQL = " select * from acdcdistribution where btsname like '%" + strBtsName + "%'";
/* 379 */       strSQL = FormateSQL.getFormateSQL(strRegistBeginTime, strRegistEndTime, strSQL);
/* 380 */       log.info(strSQL);
/* 381 */       rs = this.dbcon.execQuery(strSQL);
/* 382 */       while (rs.next()) {
/* 383 */         AcdcDistributionBO bo = new AcdcDistributionBO();
/* 384 */         bo.setId(rs.getString("id"));
/* 385 */         bo.setBtscode(rs.getString("btscode"));
/* 386 */         bo.setBtsname(rs.getString("btsname"));
/* 387 */         bo.setDistmanufacturer(rs.getString("distmanufacturer"));
/* 388 */         bo.setDisttype(rs.getString("disttype"));
/* 389 */         bo.setDistother(rs.getString("distother"));
/* 390 */         bo.setAirswitchM(rs.getString("airswitchM"));
/* 391 */         bo.setAirswitchT(rs.getString("airswitchT"));
/* 392 */         bo.setAirswitchC(rs.getString("airswitchC"));
/* 393 */         bo.setAirswitchO(rs.getString("airswitchO"));
/* 394 */         bo.setAirswitchCRD(rs.getString("airswitchCRD"));
/* 395 */         bo.setElecableDAS(rs.getString("elecableDAS"));
/* 396 */         bo.setElecableDAT(rs.getString("elecableDAT"));
/* 397 */         bo.setElecableDANum(rs.getString("elecableDANum"));
/* 398 */         bo.setElecableDALen(rs.getString("elecableDALen"));
/* 399 */         bo.setElecableDACRD(rs.getString("elecableDACRD"));
/* 400 */         bo.setRegulatorM(rs.getString("regulatorM"));
/* 401 */         bo.setRegulatorT(rs.getString("regulatorT"));
/* 402 */         bo.setRegulatorC(rs.getString("regulatorC"));
/* 403 */         bo.setRegulatorOT(rs.getDate("registtime"));
/* 404 */         bo.setRegulatorCRD(rs.getString("regulatorCRD"));
/* 405 */         bo.setLighting(rs.getString("lighting"));
/* 406 */         bo.setSocket(rs.getString("socket"));
/* 407 */         bo.setElecableCPS(rs.getString("elecableCPS"));
/* 408 */         bo.setElecableCPT(rs.getString("elecableCPT"));
/* 409 */         bo.setElecableCPNum(rs.getString("elecableCPNum"));
/* 410 */         bo.setElecableCPLen(rs.getString("elecableCPLen"));
/* 411 */         bo.setElecableCPCRD(rs.getString("elecableCPCRD"));
/* 412 */         bo.setDDConverterT(rs.getString("DDConverterT"));
/* 413 */         bo.setDDConverterM(rs.getString("DDConverterM"));
/* 414 */         bo.setDDConverterNum(rs.getString("DDConverterNum"));
/* 415 */         bo.setDDConverterC(rs.getString("DDConverterC"));
/* 416 */         bo.setDDConverterOT(rs.getDate("DDConverterOT"));
/* 417 */         bo.setDDConverterCRD(rs.getString("DDConverterCRD"));
/* 418 */         bo.setDDisplayT(rs.getString("DDisplayT"));
/* 419 */         bo.setDDisplayM(rs.getString("DDisplayM"));
/* 420 */         bo.setDDisplayNum(rs.getString("DDisplayNum"));
/* 421 */         bo.setDDisplayC(rs.getString("DDisplayC"));
/* 422 */         bo.setDDisplayOT(rs.getDate("DDisplayOT"));
/* 423 */         bo.setMaintenance(rs.getString("maintenance"));
/* 424 */         bo.setRefreshtime(rs.getDate("refreshtime"));
/* 425 */         bo.setMemo(rs.getString("memo"));
/* 426 */         list.add(bo);
/*     */       }
/*     */     }
/*     */     catch (Exception e) {
/* 430 */       e.printStackTrace();
/* 431 */       log.error(e.getMessage());
/*     */     }
/*     */     finally {
/* 434 */       dbConClose();
/*     */     }
/* 436 */     return list;
/*     */   }
/*     */ 
/*     */   public ListContentsBFO getAcdcDistributionMapList(Map condition)
/*     */   {
/* 441 */     ListContentsBFO bfo = new ListContentsBFO();
/* 442 */     int start = Integer.parseInt(condition.get("start").toString());
/* 443 */     int limit = Integer.parseInt(condition.get("limit").toString());
/* 444 */     String strAcdcId = condition.get("ACDC_ID").toString();
/* 445 */     String recordtype = condition.get("ACDC_RECORD_TYPE").toString();
/* 446 */     ResultSet rs = null;
/* 447 */     List list = new ArrayList();
/*     */     try
/*     */     {
/* 450 */       dbConInit();
/* 451 */       String strSQL = " select count(id) from acdcdistributionmap where acdcid = '" + strAcdcId + "'  and recordtype = '" + recordtype + "'";
/* 452 */       log.info(strSQL);
/* 453 */       rs = this.dbcon.execQuery(strSQL);
/* 454 */       if (rs.next()) {
/* 455 */         bfo.setTotalSize(rs.getInt(1));
/*     */       }
/* 457 */       strSQL = " select * from acdcdistributionmap where acdcid ='" + strAcdcId + "' and recordtype = '" + recordtype + "'  limit " + start + ", " + limit;
/* 458 */       log.info(strSQL);
/* 459 */       rs = this.dbcon.execQuery(strSQL);
/* 460 */       while (rs.next()) {
/* 461 */         AcdcDistributionMapBO bo = new AcdcDistributionMapBO();
/* 462 */         bo.setId(rs.getString("id"));
/* 463 */         bo.setAcdcid(rs.getString("acdcid"));
/* 464 */         bo.setDistmanufacturer(rs.getString("distmanufacturer"));
/* 465 */         bo.setPtype(rs.getString("ptype"));
/* 466 */         bo.setNum(rs.getString("num"));
/* 467 */         bo.setLen(rs.getString("len"));
/* 468 */         bo.setOther(rs.getString("other"));
/* 469 */         bo.setRecord(rs.getString("record"));
/* 470 */         bo.setRecordtype(rs.getString("recordtype"));
/* 471 */         bo.setUserful(rs.getString("userful"));
/* 472 */         bo.setMeno(rs.getString("meno"));
/* 473 */         list.add(bo);
/*     */       }
/* 475 */       bfo.setData(list.toArray());
/*     */     }
/*     */     catch (Exception e)
/*     */     {
/* 479 */       e.printStackTrace();
/* 480 */       log.error(e.getMessage());
/*     */     }
/*     */     finally {
/* 483 */       dbConClose();
/*     */     }
/* 485 */     return bfo;
/*     */   }
/*     */ 
/*     */   public boolean saveAcdcDistributionMap(AcdcDistributionMapBO bo)
/*     */   {
/* 490 */     log.info("添加--交直流配电[辅助信息]---开始");
/* 491 */     boolean flag = true;
/*     */     try
/*     */     {
/* 494 */       dbConInit();
/* 495 */       StringBuffer sqlBuf = new StringBuffer();
/* 496 */       sqlBuf.append(" insert into acdcdistributionmap ( acdcid, distmanufacturer,  ptype,  num,");
/* 497 */       sqlBuf.append(" len,  other, record, recordtype,userful,meno ) values (");
/* 498 */       sqlBuf.append(" '" + bo.getAcdcid() + "' ,");
/* 499 */       sqlBuf.append(" '" + bo.getDistmanufacturer() + "' ,");
/* 500 */       sqlBuf.append(" '" + bo.getPtype() + "' ,");
/* 501 */       sqlBuf.append(" '" + bo.getNum() + "' ,");
/* 502 */       sqlBuf.append(" '" + bo.getLen() + "' ,");
/* 503 */       sqlBuf.append(" '" + bo.getOther() + "' ,");
/* 504 */       sqlBuf.append(" '" + bo.getRecord() + "' ,");
/* 505 */       sqlBuf.append(" '" + bo.getRecordtype() + "' ,");
/* 506 */       sqlBuf.append(" '" + bo.getUserful() + "' ,");
/* 507 */       sqlBuf.append(" '" + bo.getMeno() + "' )");
/* 508 */       log.info(sqlBuf.toString());
/* 509 */       this.dbcon.execUpdate(sqlBuf.toString());
/*     */     }
/*     */     catch (Exception e)
/*     */     {
/* 513 */       flag = false;
/* 514 */       e.printStackTrace();
/* 515 */       log.error(e.getMessage());
/*     */     }
/*     */     finally {
/* 518 */       dbConClose();
/*     */     }
/* 520 */     log.info("添加--交直流配电[辅助信息]---结束");
/* 521 */     return flag;
/*     */   }
/*     */ 
/*     */   public boolean updateAcdcDistributionMap(AcdcDistributionMapBO bo) {
/* 525 */     log.info("更新--交直流配电[辅助信息]---开始");
/* 526 */     boolean flag = true;
/*     */     try
/*     */     {
/* 529 */       dbConInit();
/* 530 */       StringBuffer sqlBuf = new StringBuffer();
/* 531 */       sqlBuf.append(" update acdcdistributionmap  set ");
/* 532 */       sqlBuf.append("distmanufacturer = '" + bo.getDistmanufacturer() + "' ,");
/* 533 */       sqlBuf.append("ptype =  '" + bo.getPtype() + "' ,");
/* 534 */       sqlBuf.append("num =  '" + bo.getNum() + "' ,");
/* 535 */       sqlBuf.append("len =  '" + bo.getLen() + "' ,");
/* 536 */       sqlBuf.append("other =  '" + bo.getOther() + "' ,");
/* 537 */       sqlBuf.append("record =  '" + bo.getRecord() + "', ");
/* 538 */       sqlBuf.append("meno =  '" + bo.getMeno() + "', ");
/* 539 */       sqlBuf.append("userful =  '" + bo.getUserful() + "' ");
/* 540 */       sqlBuf.append(" where id = '" + bo.getId() + "'");
/* 541 */       log.info(sqlBuf.toString());
/* 542 */       this.dbcon.execUpdate(sqlBuf.toString());
/*     */     }
/*     */     catch (Exception e)
/*     */     {
/* 546 */       flag = false;
/* 547 */       e.printStackTrace();
/* 548 */       log.error(e.getMessage());
/*     */     }
/*     */     finally {
/* 551 */       dbConClose();
/*     */     }
/* 553 */     log.info("更新--交直流配电[辅助信息]---结束");
/* 554 */     return flag;
/*     */   }
/*     */ 
/*     */   public boolean deleteAcdcDistributionMap(String strID) {
/* 558 */     log.info("删除--交直流配电[辅助信息]" + strID + "---开始");
/* 559 */     boolean flag = true;
/*     */     try
/*     */     {
/* 562 */       dbConInit();
/* 563 */       StringBuffer sqlBuf = new StringBuffer();
/* 564 */       sqlBuf.append(" delete from  acdcdistributionmap  where id = '" + strID + "' ");
/* 565 */       log.info(sqlBuf.toString());
/* 566 */       this.dbcon.execUpdate(sqlBuf.toString());
/*     */     }
/*     */     catch (Exception e)
/*     */     {
/* 570 */       flag = false;
/* 571 */       e.printStackTrace();
/* 572 */       log.error(e.getMessage());
/*     */     }
/*     */     finally {
/* 575 */       dbConClose();
/*     */     }
/* 577 */     log.info("删除--交直流配电[辅助信息]---结束");
/* 578 */     return flag;
/*     */   }
/*     */ }

/* Location:           E:\java\apache-tomcat-6.0.36\webapps\btsm\WEB-INF\classes\
 * Qualified Name:     com.yc.dao.station.AcdcDistributionDAO
 * JD-Core Version:    0.6.2
 */